package it.polimi.traveldream.web.beans;

import java.util.List;

import it.polimi.traveldream.ejb.management.AerMgr;
import it.polimi.traveldream.ejb.management.AeroportoDTO;
import it.polimi.traveldream.ejb.management.UserMgr;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;


@ManagedBean(name = "beanRecupero")
@SessionScoped
public class BeanRecupero {
	
	@EJB
	private UserMgr usrMgr;
	
	private String mail;
	
	public String getMail(){
		return this.mail;
	}
	
	public void setMail(String mail) {
		this.mail = mail;
	}
	
	
	
	public String invia(){
		List <String> listMail=usrMgr.listaMailUtenti();
		if(listMail.contains(mail))
			return "mailOK?faces-redirect=true";
		return "erroreMail?faces-redirect=true";
	}
	
	

}

